/* 弹窗基础样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  display: none;
  overflow: hidden;
  outline: 0;
}

.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: calc(var(--space-unit) * 2);
  pointer-events: none;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--bg-color);
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  outline: 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 0.5;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(var(--space-unit) * 2);
  border-bottom: 1px solid var(--border-color);
  border-top-left-radius: calc(var(--radius) - 1px);
  border-top-right-radius: calc(var(--radius) - 1px);
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: calc(var(--space-unit) * 2);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: calc(var(--space-unit) * 1.5);
  border-top: 1px solid var(--border-color);
  border-bottom-right-radius: calc(var(--radius) - 1px);
  border-bottom-left-radius: calc(var(--radius) - 1px);
}

.modal-footer > * {
  margin: 0 calc(var(--space-unit) * 0.5);
}

.modal-scrollbar-measure {
  position: absolute;
  top: -9999px;
  width: 50px;
  height: 50px;
  overflow: scroll;
}

/* 确认弹窗 */
.confirm-modal .modal-content {
  max-width: 400px;
}

/* 提示弹窗 */
.alert-modal .modal-content {
  max-width: 350px;
}

.alert-modal .modal-body {
  text-align: center;
}

/* 输入弹窗 */
.input-modal .modal-content {
  max-width: 450px;
}

/* 悬浮弹窗 */
.popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1060;
  display: block;
  max-width: 276px;
  font-family: var(--font-family);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-align: start;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  word-spacing: normal;
  white-space: normal;
  line-break: auto;
  font-size: 0.875rem;
  word-wrap: break-word;
  background-color: var(--bg-color);
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.popover .arrow {
  position: absolute;
  display: block;
  width: 1rem;
  height: 0.5rem;
  margin: 0 var(--radius);
}

.popover .arrow::before,
.popover .arrow::after {
  position: absolute;
  display: block;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.popover-header {
  padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);
  margin-bottom: 0;
  font-size: 1rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  border-top-left-radius: calc(var(--radius) - 1px);
  border-top-right-radius: calc(var(--radius) - 1px);
}

.popover-body {
  padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);
  color: var(--text-primary);
}

/* 公告栏 */
.announcement-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--primary-color);
  color: white;
  padding: calc(var(--space-unit) * 1.5);
  z-index: 1040;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.announcement-content {
  flex: 1;
  margin-right: calc(var(--space-unit) * 2);
}

.announcement-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: calc(var(--space-unit) * 0.5);
}